﻿
@{
    ViewBag.Title = "找回密码";
    Layout = "~/Views/Shared/_LayoutMain.cshtml";
}

<div class="main layui-clear">
    <h2 class="page-title">找回密码</h2>
    @if (string.IsNullOrEmpty(ViewBag.token))
    {
        <div class="layui-form layui-form-pane">
            <form method="post">
                <div class="layui-form-item">
                    <label for="L_email" class="layui-form-label">邮箱</label>
                    <div class="layui-input-inline">
                        <input type="text" id="email" name="email" required lay-verify="required" autocomplete="off" class="layui-input" value="@ViewBag.Email">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label for="Vercode" class="layui-form-label">人类验证</label>
                    <div class="layui-input-inline">
                        <input type="text" id="Vercode" name="vercode" required lay-verify="required" placeholder="请输入验证码" autocomplete="off" class="layui-input">
                    </div>
                    <div class="layui-form-mid vercodeimg">
                    </div>
                </div>
                <div class="layui-form-item">
                    <button class="layui-btn" alert="1" lay-filter="*" lay-submit>提交</button>
                </div>
            </form>
        </div>
    }
    else
    {
        if (ViewBag.TokenError)
        {
            <div class="fly-error">该重置密码链接已失效，请重新校验您的信息</div>
        }
        else
        {
        <div class="fly-msg">请重置您的密码</div>
        <div class="layui-form layui-form-pane" style="margin-top: 30px;">
            <form action="@Url.Action("forgetsetpassword","user")" method="post">
                <div class="layui-form-item">
                    <label for="password" class="layui-form-label">密码</label>
                    <div class="layui-input-inline">
                        <input type="password" id="password" name="password" required lay-verify="required" autocomplete="off" class="layui-input">
                    </div>
                    <div class="layui-form-mid layui-word-aux">6到16个字符</div>
                </div>
                <div class="layui-form-item">
                    <label for="confirmpassword" class="layui-form-label">确认密码</label>
                    <div class="layui-input-inline">
                        <input type="password" id="confirmpassword" name="confirmpassword" required lay-verify="required" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label for="Vercode" class="layui-form-label">人类验证</label>
                    <div class="layui-input-inline">
                        <input type="text" id="Vercode" name="vercode" required lay-verify="required" placeholder="请输入验证码" autocomplete="off" class="layui-input">
                    </div>
                    <div class="layui-form-mid vercodeimg">
                    </div>
                </div>
                <div class="layui-form-item">
                    <input type="hidden" name="token" value="@ViewBag.token">
                    <button class="layui-btn" alert="1" lay-filter="*" lay-submit>提交</button>
                </div>
            </form>
        </div>

        }
    }
</div>

@section main_back_Script
{
    <script type="text/javascript">
        //表单异步提交
        //验证码刷新
        layui.use(['formsubmit','verifycode']);
    </script>
}
